package com.kylin.system.common.enums;

import com.kylin.common.redis.keys.AbstractRedisKeys;

/**
 * 后台模块redis keys
 * @author wuhao
 * @version 1.0 - 2021/7/14
 */
public enum SystemRedisKeys implements AbstractRedisKeys {

    /** 参数管理 cache key */
    SYS_CONFIG_KEY("sys:config:"),
    /** 字典管理 cache key */
    SYS_DICT_KEY("sys:dict:"),
    /** 角色缓存信息 */
    SYS_ROLE_KEY("sys:role:list"),
    
    /** 自定义配置列表 */
    SYS_CONFIG_CUSTOM_KEY("sys:config:custom:list")

    ;
    private String key;
    private Long expireTime = DEFAULT_EXPIRE_TIME;

    SystemRedisKeys(String key) {
        this.key = key;
    }


    SystemRedisKeys(String key, Long expireTime) {
        this.key = key;
        this.expireTime = expireTime;
    }

    @Override
    public String key() {
        return this.key ;
    }

    @Override
    public String key(String key) {
        return this.key + key;
    }

    @Override
    public Long expireTime() {
        return this.expireTime;
    }
}

